46 CaptureBaseWPtr capture_ptr_;
47 FactorBasePtrList factor_list_;
49 static unsigned int feature_id_count_;
79 const Eigen::VectorXd& _measurement,
80 const Eigen::MatrixXd& _meas_uncertainty,
89 virtual void remove(
bool viral_remove_parent_without_children =
false);
92 return not factor_list_.empty();
98 unsigned int id()
const;
144 void setMeasurement(
const Eigen::VectorXd& _meas);
148 void setMeasurementCovariance(
const Eigen::MatrixXd& _meas_cov);
153 void setMeasurementInformation(
const Eigen::MatrixXd& _meas_info);
211 bool hasFactor(FactorBaseConstPtr _fac)
const;
215 void link(CaptureBasePtr cap_ptr);
219 template <
typename classType,
typename... T>
220 static std::shared_ptr<classType>
emplace(CaptureBasePtr _cpt_ptr, T&&... all);
228 std::ostream& stream,
229 std::string _tabs =
"")
const;
233 void print(
int depth,
237 std::ostream& stream = std::cout,
238 std::string _tabs =
"")
const;
242 virtual CheckLog localCheck(
bool _verbose, std::ostream& _stream, std::string _tabs =
"")
const;
246 bool check(
CheckLog& _log,
bool _verbose, std::ostream& _stream, std::string _tabs =
"")
const;
251 void setCapture(CaptureBasePtr _cap_ptr)
253 capture_ptr_ = _cap_ptr;
258 FactorBasePtr addFactor(FactorBasePtr _co_ptr);
262 void removeFactor(FactorBasePtr _co_ptr);
273template <
typename classType,
typename... T>
276 std::shared_ptr<classType> ftr = std::make_shared<classType>(std::forward<T>(all)...);
283 FactorBaseConstPtrList list_const;
284 for (
auto&& obj_ptr : factor_list_) list_const.push_back(obj_ptr);
300 return capture_ptr_.lock();
305 return capture_ptr_.lock();
Base class of captures: a sensor measurement taken at a time stamp, linked to a frame,...
Definition: capture_base.h:41
Log of a consistency check: whether it is consistent and the explanation of the inconsistencies.
Definition: check_log.h:30
Base class of factors: a constraint between state blocks of one or more nodes, given a measurement an...
Definition: factor_base.h:73
Base class of features: a measurement with its uncertainty, extracted from a capture,...
Definition: feature_base.h:40
bool hasFactor(FactorBaseConstPtr _fac) const
Returns whether the factor belongs to the feature.
Definition: feature_base.cpp:97
unsigned int feature_id_
Feature id, unique among features.
Definition: feature_base.h:52
FeatureBase(const std::string &_type, const Eigen::VectorXd &_measurement, const Eigen::MatrixXd &_meas_uncertainty, UncertaintyType _uncertainty_type=UNCERTAINTY_IS_COVARIANCE)
Constructor from the measurement and its uncertainty.
Definition: feature_base.cpp:28
CaptureBaseConstPtr getCapture() const
Returns the capture the feature belongs to (nullptr if none)
Definition: feature_base.h:298
Eigen::VectorXd expectation_
Expected measurement.
Definition: feature_base.h:58
Eigen::MatrixXd measurement_covariance_
Measurement covariance matrix.
Definition: feature_base.h:56
Eigen::MatrixXd measurement_sqrt_information_upper_
Upper square root of the information matrix.
Definition: feature_base.h:57
Eigen::MatrixXd getMeasurementInformation() const
Returns the measurement information matrix.
Definition: feature_base.h:323
void link(CaptureBasePtr cap_ptr)
Links the feature to a capture.
Definition: feature_base.cpp:152
const Eigen::MatrixXd & getMeasurementSquareRootInformationUpper() const
Returns the upper triangular square root of the measurement information matrix.
Definition: feature_base.h:328
void setLandmarkId(unsigned int _lmk_id)
Sets the id of the landmark.
Definition: feature_base.h:123
static std::shared_ptr< classType > emplace(CaptureBasePtr _cpt_ptr, T &&... all)
Creates a feature of class classType and links it to the capture.
Definition: feature_base.h:274
bool hasChildren() const override
Returns whether the node has children in the Wolf tree.
Definition: feature_base.h:90
~FeatureBase() override=default
UncertaintyType
Type of the measurement uncertainty passed to the constructor.
Definition: feature_base.h:64
@ UNCERTAINTY_IS_STDDEV
Standard deviations (not implemented)
Definition: feature_base.h:67
@ UNCERTAINTY_IS_INFO
Information matrix.
Definition: feature_base.h:66
@ UNCERTAINTY_IS_COVARIANCE
Covariance matrix.
Definition: feature_base.h:65
const Eigen::VectorXd & getMeasurement() const
Returns the measurement vector.
Definition: feature_base.h:313
unsigned int track_id_
ID of the feature track.
Definition: feature_base.h:53
const Eigen::VectorXd & getExpectation() const
Returns the expected measurement.
Definition: feature_base.h:333
FactorBaseConstPtrList getFactorList() const
Returns the factors of the feature.
Definition: feature_base.h:281
Eigen::VectorXd measurement_
Measurement vector.
Definition: feature_base.h:55
virtual void printHeader(int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream, std::string _tabs="") const
Prints the information of this node (not of its children)
Definition: feature_base.cpp:168
void setExpectation(const Eigen::VectorXd &expectation)
Sets the expected measurement.
Definition: feature_base.h:338
unsigned int landmark_id_
ID of the landmark.
Definition: feature_base.h:54
FrameBaseConstPtr getFrame() const
Returns the frame of the capture the feature belongs to.
Definition: feature_base.cpp:112
virtual CheckLog localCheck(bool _verbose, std::ostream &_stream, std::string _tabs="") const
Checks the consistency of this node (not of its children)
Definition: feature_base.cpp:195
void print(int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream=std::cout, std::string _tabs="") const
Prints this node and, depending on the depth, its children.
Definition: feature_base.cpp:182
unsigned int id() const
Returns the feature id.
Definition: feature_base.h:293
void setTrackId(unsigned int _tr_id)
Sets the id of the feature track.
Definition: feature_base.h:109
unsigned int trackId() const
Returns the id of the feature track.
Definition: feature_base.h:102
unsigned int landmarkId() const
Returns the id of the landmark.
Definition: feature_base.h:116
bool check(CheckLog &_log, bool _verbose, std::ostream &_stream, std::string _tabs="") const
Checks the consistency of this node and its children, composing the log.
Definition: feature_base.cpp:233
const Eigen::MatrixXd & getMeasurementCovariance() const
Returns the measurement covariance.
Definition: feature_base.h:318
virtual void remove(bool viral_remove_parent_without_children=false)
Removes the feature and its factors.
Definition: feature_base.cpp:56
Base class for Nodes.
Definition: node_base.h:73
Base class of sensors: their state blocks (extrinsics and intrinsics, static or dynamic),...
Definition: sensor_base.h:128
Definition: capture_base.h:23